package com.geekhalo.admin.app.user.query;

import com.geekhalo.admin.domain.user.UserStatus;
import com.geekhalo.lego.annotation.singlequery.FieldEqualTo;
import com.geekhalo.lego.core.singlequery.Pageable;
import lombok.AccessLevel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;

@NoArgsConstructor
@Data
public class SearchUserQuery{

    @FieldEqualTo("status")
    private UserStatus status;

    @FieldEqualTo("loginName")
    private String loginName;

    @Setter(AccessLevel.PRIVATE)
    private Pageable pageable = Pageable.builder().build();

    public void setCurrent(Integer current){
        pageable.setPageNo(current - 1);
    }

    public void setPageSize(Integer pageSize){
        pageable.setPageSize(pageSize);
    }

}
